package com.jy.rhin.model;


import com.jy.rhin.infra.cda.EDataElement;
import com.jy.rhin.infra.cda.XPath;
import com.jy.rhin.infra.cda.XValid;
import com.jy.rhin.model.body.jiankangtj.*;
import com.jy.rhin.model.body.jiankangtj.YuFangJZ;
import com.jy.rhin.model.body.zhengzhuang.ZhengZhuang;
import com.jy.rhin.model.header.LegalAuthenticator;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

@Data
@EqualsAndHashCode(callSuper = false)
public class JianKangTJ extends ClinicalDocumentData {
    //文档唯一id
//    @XPath(path = "/id/@extension"
//            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE01_00_008_00))
//    String id;

    @XPath(path = "/legalAuthenticator")
    LegalAuthenticator legalAuthenticator;

    /** 症状列表 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='11450-4'][@codeSystem='2.16.840.1.113883.6.1']/.."
            , listItemBackLevel = 0
            , listItemPath = "/entry")
    List<ZhengZhuang> zhengZhuangList;

    /** 生命体征 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='8716-3'][@codeSystem='2.16.840.1.113883.6.1']/..")
    ShengMingTZ shengMingTZ;

    /** 口腔、咽喉和牙齿章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='10201-2'][@codeSystem='2.16.840.1.113883.6.1']/..")
    KouQiang kouQiang;

    /** 眼章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='10197-2'][@codeSystem='2.16.840.1.113883.6.1']/..")
    YanBu yanBu;

    /** 耳章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='10195-6'][@codeSystem='2.16.840.1.113883.6.1']/../entry/observation/value"
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE04_10_190_00))
    CodeObject tingLi;

    /** 腹部 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='10191-5'][@codeSystem='2.16.840.1.113883.6.1']/..")
    FuBu fuBu;

    /** 功能检查章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='46006-3'][@codeSystem='2.16.840.1.113883.6.1']/..")
    GongNengJC gongNengJC;

    /** 心脏章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='10200-4'][@codeSystem='2.16.840.1.113883.6.1']/..")
    XinZhang xinZhang;

    /** 血管 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='10208-7'][@codeSystem='2.16.840.1.113883.6.1']/..")
    XueGuan xueGuan;

    /** 呼吸系统 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='11412-4'][@codeSystem='2.16.840.1.113883.6.1']/..")
    HuXiXT huXiXT;

    /** 皮肤 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='29302-7'][@codeSystem='2.16.840.1.113883.6.1']/..")
    PiFu piFu;

    /** 淋巴系统 */
    // 淋巴结检查结果代码
    @XPath(path = "/component/structuredBody/component/section/code[@code='11447-0'][@codeSystem='2.16.840.1.113883.6.1']/../entry/observation/code[@code='DE04.10.113.00'][@codeSystem='2.16.156.10011.2.2.1']/../value", xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE04_10_113_00))
    CodeObject linBaJC;

    /** 四肢章节 */
    // 下肢水肿检查结果代码
    @XPath(path = "/component/structuredBody/component/section/code[@code='10196-4'][@codeSystem='2.16.840.1.113883.6.1']/../entry/observation/code[@code='DE04.10.201.00'][@codeSystem='2.16.156.10011.2.2.1']/../value"
            , xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE04_10_201_00))
    CodeObject xiaZhiSZ;

    /** 直肠章节 */
    // 肛门指诊检查结果类别代码
    @XPath(path = "/component/structuredBody/component/section/code[@code='10205-3'][@codeSystem='2.16.840.1.113883.6.1']/../entry/observation/code[@code='DE04.10.064.00'][@codeSystem='2.16.156.10011.2.2.1']/../value",
            xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE04_10_064_00, nullable = true))
    CodeObject gangMenZZ;

    /** 乳腺章节 */
    // 乳腺检查结果代码
    @XPath(path = "/component/structuredBody/component/section/code[@code='10193-1'][@codeSystem='2.16.840.1.113883.6.1']/../entry/observation/code[@code='DE04.10.159.00'][@codeSystem='2.16.156.10011.2.2.1']/../value",
            xValid = @XValid(type = "dataElement", dataElement = EDataElement.DE04_10_159_00, nullable = true))
    CodeObject ruXian;

    /** 生殖器章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='11400-9'][@codeSystem='2.16.840.1.113883.6.1']/..")
    ShengZhiQ shengZhiQ;

    /** 实验室检查章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='30954-2'][@codeSystem='2.16.840.1.113883.6.1']/..")
    ShiYanSJC shiYanSJC;

    /** 辅助检查章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@displayName='辅助检查']/..")
    FuZhuJC fuZhuJC;

    /** 诊断记录章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='29548-5'][@codeSystem='2.16.840.1.113883.6.1']/..")
    ZhenDuanJL zhenDuanJL;

    /** 用药章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='10160-0'][@codeSystem='2.16.840.1.113883.6.1']/..")
    List<YongYao> yongYao;

    /** 家族史章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='10157-6'][@codeSystem='2.16.840.1.113883.6.1']/..")
    JiaZuS jiaZuS;

    /** 住院史章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='11336-5'][@codeSystem='2.16.840.1.113883.6.1']/..",
            listItemPath = "/entry/encounter/code[@displayName='住院史']/..", listItemBackLevel = 0)
    List<ZhuYuanS> zhuYuanSList;

    @XPath(path = "/component/structuredBody/component/section/code[@code='11336-5'][@codeSystem='2.16.840.1.113883.6.1']/..",
            listItemPath = "/entry/encounter/code[@displayName='家庭病床史']/..", listItemBackLevel = 0)
    List<BingChuangS> bingChuangSList;

    /** 预防接种史章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='11369-6'][@codeSystem='2.16.840.1.113883.6.1']/.."
            , listItemPath = "/entry/substanceAdministration",
            listItemBackLevel = 0)
    List<YuFangJZ> yuFangJZList = new ArrayList<>();

    /** 职业暴露史章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='10161-8'][@codeSystem='2.16.840.1.113883.6.1']/..",
            listItemPath = "/entry/observation",
            listItemBackLevel = 0)
    List<ZhiYeBLS> zhiYeBLSList = new ArrayList<>();

    /** 生活方式章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@displayName='生活方式']/..")
    ShengHuoFS shengHuoFS;

    /** 健康评估章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='51848-0'][@codeSystem='2.16.840.1.113883.6.1']/..")
    JianKangPG jianKangPG;

    /** 健康指导章节 */
    @XPath(path = "/component/structuredBody/component/section/code[@code='69730-0'][@codeSystem='2.16.840.1.113883.6.1']/..")
    JianKangZD jianKangZD;
}
